import { resolve } from 'path';
import { defineConfig } from 'vite';

import vue from '@vitejs/plugin-vue';

const pathResolve = dir => resolve(__dirname, dir)

// https://vite.dev/config/
export default defineConfig({
  plugins: [vue()],
  pluginsOptions: {
    'style-resources-loader': {
      preProcessor: 'scss',
      patterns: [],
    },
  },
  server: {
    port: 3839,
    open: true,
    cors: true,
    host: 'localhost',
  },
  // 配置模块解析别名，用于简化文件路径引用
  resolve: {
    alias: {
       // 设置@符号指向src目录的绝对路径
      '@': pathResolve('./src')
    }
  }
})
